<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>商品数据</title>
		<link rel="stylesheet" href="css/_all-skins.min.css" />
		<link rel="stylesheet" href="css/AdminLTE.min.css" />
		<link rel="stylesheet" href="css/bootstrap.min.css" />
		<link rel="stylesheet" href="css/daterangepicker.css" />
		<link rel="stylesheet" href="css/select2.min.css" />
		<link rel="stylesheet" href="css/font-awesome.min.css" />
		<link rel="stylesheet" type="text/css" href="css/layer.css"/>
		<link rel="stylesheet" href="css/product_data.css" />
	</head>
	<style>
		 .select2-search__field{
		 	display: none;
		 }
		 .select2-results__option--highlighted[aria-selected]{
		 	background:#3c8dbc!important ;
		 }
	</style>
	<body class="hold-transition skin-blue sidebar-mini fixed">
<div class="wrapper">

    <header class="main-header">
    <!-- Logo -->
    <a href="index2.html" class="logo">
      <!-- mini logo for sidebar mini 50x50 pixels -->
   
      <!-- logo for regular state and mobile devices -->
      <span class="logo-lg"><b>衣当先</b>CRM</span>
    </a>
    <!-- Header Navbar: style can be found in header.less -->
    <nav class="navbar navbar-static-top">
      <!-- Sidebar toggle button-->
      <a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
        <span class="sr-only">Toggle navigation</span>
      </a>

      <div class="navbar-custom-menu">
        <ul class="nav navbar-nav">
          <li class="dropdown user user-menu">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown">
            	
              <img src="img/user2-160x160.jpg" class="user-image" alt="User Image">
              <span class="hidden-xs  manger-name">Amy</span>
               
            	 <span class="change_password" style="font-size: 12px;margin-left: 40px;">修改密码</span>
            	 <span class="exit_login" style="font-size: 12px;">退出登录</span>
            </a>
            
          </li>
        </ul>
      </div>
    </nav>
  </header>
  <!-- Left side column. contains the logo and sidebar -->
  <aside class="main-sidebar">
    <!-- sidebar: style can be found in sidebar.less -->
    <section class="sidebar">
      <!-- Sidebar user panel -->
      <div class="user-panel">
        <div class="pull-left image">
          <img src="img/user2-160x160.jpg" class="img-circle">
        </div>
        <div class="pull-left info">
          <p class="manger-name">Amy</p>
          <a href="#"><i class="fa fa-circle text-success"></i> 在线</a>
        </div>
      </div>
      <!-- search form -->
      <form action="#" method="get" class="sidebar-form">
        <div class="input-group">
          <input type="text" name="q" class="form-control" placeholder="Search...">
          <span class="input-group-btn">
                <button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i>
                </button>
              </span>
        </div>
      </form>
      <!-- /.search form -->
      <!-- sidebar menu: : style can be found in sidebar.less -->
      <ul class="sidebar-menu" data-widget="tree">
        <li class="header">功能目录</li>
        
        <li class=" treeview">
          <a href="#">
            <i class="fa fa-dashboard"></i> <span>系统首页</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          <ul class="treeview-menu">
            <li class=""><a href="index.html"><i class="fa fa-circle-o"></i> 首页总览</a></li>
            <li><a href="login_log.html"><i class="fa fa-circle-o"></i> 登录日志</a></li>
              <li><a href="id_manager.html"><i class="fa fa-circle-o"></i> 账号管理</a></li>
          </ul>
        </li>
      
        <li class="treeview">
          <a href="#">
            <i class="fa fa-laptop"></i>
            <span>商品管理</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
           <ul class="treeview-menu">
            <li><a href="product_list.html"><i class="fa fa-circle-o"></i> 商品列表</a></li>
            <li><a href="new_product.html"><i class="fa fa-circle-o"></i> 新增商品</a></li>
            <li><a href="product_kind.html"><i class="fa fa-circle-o"></i> 商品分类</a></li>
            <li><a href="product_confirm.html"><i class="fa fa-circle-o"></i> 商品审核</a></li>
             <li><a href="product_income.html"><i class="fa fa-circle-o"></i> 商品回收</a></li>
          </ul>
        </li>

        <li class="treeview">
          <a href="#">
            <i class="fa fa-edit"></i> <span>订单管理</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          <ul class="treeview-menu">
            <li><a href="hire_order.html"><i class="fa fa-circle-o"></i> 租赁订单</a></li>
            <li><a href="pay_order.html"><i class="fa fa-circle-o"></i> 支付订单</a></li>
            <li><a href="operate_log.html"><i class="fa fa-circle-o"></i> 订单日志</a></li>
          </ul>
        </li>          
        <li class="treeview">
          <a href="#">
            <i class="fa fa-pie-chart"></i>
            <span>用户管理</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          <ul class="treeview-menu">
            <li><a href="user_list.html"><i class="fa fa-circle-o"></i> 用户列表</a></li>
            <li><a href="discounts.html"><i class="fa fa-circle-o"></i> 优惠卷中心</a></li>
          </ul>
        </li>
        <li class="active treeview">
          <a href="#">
            <i class="fa fa-pie-chart"></i>
            <span>数据管理</span>
            <span class="pull-right-container">
              <i class="fa fa-angle-left pull-right"></i>
            </span>
          </a>
          <ul class="treeview-menu">
            <li><a href="all_data.html"><i class="fa fa-circle-o"></i> 数据日报</a></li>
            <li class="active"><a href="product_data.html"><i class="fa fa-circle-o"></i> 商品数据</a></li>
            <li><a href="order_data.html"><i class="fa fa-circle-o"></i> 订单数据</a></li>
            <li><a href="user_data.html"><i class="fa fa-circle-o"></i> 用户数据</a></li>
           <li><a href="income_data.html"><i class="fa fa-circle-o"></i> 收入数据</a></li>
          </ul>
        </li>      
        <li>
          <a href="advice.html">
            <i class="fa fa-files-o"></i> <span>反馈建议</span>
          </a>
        </li>
         <li>
          <a href="w_internet.html">
            <i class="fa fa-book"></i> <span>物联网订单</span>
          </a>
        </li>
      </ul>
    </section>
    <!-- /.sidebar -->
  </aside>

  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    

    <!-- Main content -->
           
    
    <section class="content" >
       <div class="row">
       	 <div class="col-lg-1"></div>
       	 <div class="col-lg-10">
       	 	
       	 	<div class="order_status">
       	 			<div>
       	 				<span>0</span><br />
       	 				<label>库存总量</label>
       	 			</div>
       	 			
       	 			<div>
       	 				<span>0</span><br />
       	 				<label>总品类量</label>
       	 			</div>
       	 			
       	 			<div>
       	 				<span>0</span><br />
       	 				<label>已上架商品</label>
       	 			</div>
       	 			
       	 			<div>
       	 				<span>0</span><br />
       	 				<label>未上架商品</label>
       	 			</div>
       	 			<div>
       	 				<span>0</span><br />
       	 				<label>待审核商品</label>
       	 			</div>
       	 			<div>
       	 				<span>0</span><br />
       	 				<label>过期商品</label>
       	 			</div>
       	 	</div>
       	 	<div class="change_btn">
       	 		<div class="select_box">
       	 			<span>商品变动明细：</span>
       	 			<div>
       	 				<input type="text" placeholder="请输入时间范围" class="date_pick form-control " id="reservation" >
       	 				<input type="button" class="btn btn-default search_base" value="筛选"/>
       	 			</div>
       	 		</div>
       	 		
       	 		<table class= " col-lg-12 product_num">
       	 			<thead>
       	 				<tr class="base_infor1">
       	 					<th>日期</th>
       	 					<th>新增商品</th>
       	 					<th>新增品类</th>
       	 					<th>租出商品</th>
       	 					<th>归还商品</th>
       	 					<th>上架商品</th>
       	 					<th>总库存商品</th>
       	 				</tr>
       	 				
       	 			</thead>
	       	 		<tbody class="table_data">
	       	 	     <!--<tr>
	       	 	     	<td>6月24日</td>
	       	 	     	<td>11</td>
	       	 	     	<td>234</td>
	       	 	     	<td>45</td>
	       	 	     	<td>55</td>
	       	 	     	<td>33</td>
	       	 	     	<td>5555</td>
	       	 	     </tr>-->
	       	 	
	       	 		</tbody>
       	 	</table>
       	 	</div>
      
       	 	<div class="change_btn">
       	 		<div class="select_box">
       	 			<span>七日热销排行：</span>
       	 		</div>
       	 		
       	 		<table class= " col-lg-12 product_num">
       	 			<thead>
       	 				<tr class="base_infor1">
       	 					<th style="width: 120px;">排行</th>
       	 					<th>top1</th>
       	 					<th>top2</th>
       	 					<th>top3</th>
       	 					<th>top4</th>
       	 					<th>top5</th>
       	 				</tr>
       	 				
       	 			</thead>
	       	 		<tbody class="table_data2">
		       	 	    <tr></tr>
		       	 	    <tr></tr>
		       	 	    <tr></tr>
		       	 	    <tr></tr>
		       	 	    <tr></tr>
	       	 		</tbody>
       	 	    </table>
       	 	</div>
			<div class="change_btn">
       	 		<div class="select_box2">
       	 			
       	 			<span class="select_title">商品效果列表：</span>
       	 			
       	 				<select class="select2 form-control search_kind" style="width: 120px;">
       	 					<option value="全部">全部</option>
       	 					<option value="婚礼宴会">婚礼宴会</option>
       	 					<option value="商务职场">商务职场</option>
       	 					<option value="日常休闲">日常休闲</option>
       	 				</select>
       	 				<input type="text" class="form-control search_text" placeholder="商品名" style="width: 120px;display: inline-block;" />
       	 				<input type="button" class="btn btn-default search_pro" value="筛选"/>
       	 			
       	 		</div>
       	 		
       	 		<table class= " col-lg-12 product_num">
       	 			<thead>
       	 				<tr class="base_infor1">
       	 					<th>商品编号</th>
       	 					<th>商品名</th>
       	 					<th>商品样图</th>
       	 					<th>浏览量</th>
       	 					<th>租赁量</th>
       	 					<th>转化率</th>
       	 					<th>在架/库存</th>
       	 					<th>上架时间</th>
       	 				</tr>
       	 				
       	 			</thead>
	       	 		<tbody class="table_data3">
	       	 	     
	       	 	
	       	 		</tbody>
       	 	</table>
       	 	</div>
       	 </div>
       </div>

     
    </section>
    <!-- /.content -->
  </div>
   
  <!-- /.content-wrapper -->
  <footer class="main-footer">
    <div class="pull-right hidden-xs">
      <b>Version</b> 2.0.0
    </div>
    <strong>Copyright &copy; 2017-2018 西安寒武纪信息科技有限公司.</strong> All rights
    reserved.
  </footer>
</div>
<script src="js/jquery.min.js"></script>



<script src="js/adminlte.min.js"></script>
<script type="text/javascript" src="js/moment.min.js" ></script>
<script src="js/daterangepicker.js"></script>
<script src="js/select2.full.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/layer.js" ></script>
<script type="text/javascript" src="js/jq.cookie.js" ></script>
<script src="js/change_password.js"></script>
<script>
	 $('.select2').select2();
	  $('#reservation').daterangepicker({
	  	startDate:"2018-11-01",
	  	locale:{format:'YYYY-MM-DD'}
	  });
	   $('#reservation2').daterangepicker({
	   	startDate:"2018-11-01",
	  	locale:{format:'YYYY-MM-DD'}
	  });
	  var Kind = 1;
	  $('#reservation').change(function(){
	  	Kind = 2;
	  })
	  $('.search_base').click(function(){
	  	getData();
	  })
	  
	  $('.search_pro').click(function(){
	  	var Type = $('.search_kind').select2('val');
	  	var Content = $('.search_text').val();
	  	$.ajax({
	  		type:"get",
	  		url:"https://www.retux.cn/MgProductLogSearch",
	  		async:true,
	  		data:{
	  			Type:Type,
	  			Content:Content
	  		},
	  		success:function(data){
	  			if(data.length==0){
				  			layer.msg('暂无数据');
				  		}else{
			  			     $('.table_data3').html("");
			  				 for (var i=0;i<data.length;i++) {
						  	  	var Tr = `
						  	  			<tr>
						       	 	     	<td>${data[i][0]}</td>
						       	 	     	<td>${data[i][1]}</td>
						       	 	     	<td>
						       	 	     		<img src="${data[i][2]}" width="70px" height="70px"/>
						       	 	     	</td>
						       	 	     	<td>${data[i][3]}</td>
						       	 	     	<td>${data[i][4]}</td>
						       	 	     	<td>${data[i][5]}</td>
						       	 	     	<td>${data[i][6]}</td>
						       	 	     	<td>${data[i][7]}</td>
						       	 	     </tr>
						  	  	`;
						  	  	$('.table_data3').append(Tr);
						  	  }
	  				 }
	  		}
	  	});
	  	
	  })
	  getData();
	  function getData(){
	  	var data_rang = $('#reservation').val();//时间范围
	    var start = data_rang.split(' -')[0];
		var end = data_rang.split('- ')[1];
		
		$.ajax({
			type:"get",
			url:"https://www.retux.cn/MgProductLog",
			async:true,
			data:{
				Kind:Kind,
				start:start,
				end:end
			},
			success:function(data){
				if(data.length==0){
				  			layer.msg('暂无数据');
				  		}else{
				  			dataView(data)
				  		}
				
			}
		});
	  }
	  function dataView(data){
	  	   $('.table_data').html("");
	  	   $('.table_data3').html("");
	  	    $('.table_data2').find('tr').html("");
	  	   var orderLabel = $('.order_status').find("span");
	  	   for (var i=0;i<data[0].length;i++) {
	  	  	  orderLabel.eq(i).text(data[0][i])
	  	   }
	  	   
	  	   if( data[1].length){
	  	   	for (var i =0;i<data[1].length;i++) {
		  	   	 var Tr = `<tr>
		       	 	     	<td>${data[1][i][0]}</td>
		       	 	     	<td>${data[1][i][1]}</td>
		       	 	     	<td>${data[1][i][2]}</td>
		       	 	     	<td>${data[1][i][3]}</td>
		       	 	     	<td>${data[1][i][4]}</td>
		       	 	     	<td>${data[1][i][5]}</td>
		       	 	     	<td>${data[1][i][6]}</td>
		       	 	     </tr>`;
		       	  $('.table_data').append(Tr)
		  	   }
	  	   }
	  	   
	  	   var numPi = ['商品名','浏览器','租赁量','转化率','商品图'];
	  	   //
	  	   for(var i=0;i<numPi.length;i++){
	  	   	 $('.table_data2').find('tr').eq(i).append('<td class="base_infor1">'+numPi[i]+'</td>')
	  	   }
	  	   if(data[2].length){
		  	   for(var i=0;i<5;i++){
		  	   	for (var j=0;j<data[2][i].length;j++) {
		  	   		if(j==0){
		  	   			
		  	   			 $('.table_data2').find('tr').eq(0).append('<td>'+data[2][i][0]+'</td>')
		  	   		}else if(j==1){
		  	   			
		  	   			$('.table_data2').find('tr').eq(1).append('<td>'+data[2][i][1]+'</td>')
		  	   		}else if(j==2){
		  	   			
		  	   			$('.table_data2').find('tr').eq(2).append('<td>'+data[2][i][2]+'</td>')
		  	   		}else if(j==3){
		  	   			
		  	   			$('.table_data2').find('tr').eq(3).append('<td>'+data[2][i][3]+'</td>')
		  	   		}else if(j==4){
		  	   			
		  	   			$('.table_data2').find('tr').eq(4).append('<td><img src="'+data[2][i][4]+'" /></td>')
		  	   		}
		  	   		
		  	   	 }
		  	   }
	  	   }
	  	
	  	  for (var i=0;i<data[3].length;i++) {
	  	  	var Tr = `
	  	  			<tr>
	       	 	     	<td>${data[3][i][0]}</td>
	       	 	     	<td>${data[3][i][1]}</td>
	       	 	     	<td>
	       	 	     		<img src="${data[3][i][2]}" width="70px" height="70px"/>
	       	 	     	</td>
	       	 	     	<td>${data[3][i][3]}</td>
	       	 	     	<td>${data[3][i][4]}</td>
	       	 	     	<td>${data[3][i][5]}</td>
	       	 	     	<td>${data[3][i][6]}</td>
	       	 	     	<td>${data[3][i][7]}</td>
	       	 	     </tr>
	  	  	`;
	  	  	$('.table_data3').append(Tr);
	  	  }
	  }
	  
</script>
</body>
</html>
